Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rabbit_feature_flags: Protect concurrent reloads of the registry #10027

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

dumbbell
Copy link
Member

@dumbbell dumbbell commented Dec 1, 2023

Why

When a node joins another node, it resets its feature flags registry (the registry is unloaded) and it copies the feature flags states from the remote cluster.

Before this patch, there was a small window where a concurrent use of the registry right between these two steps would reload a registry from the default/empty states, which does not reflect the intent.

This could happen because another node is running peer discovery and queries the cluster membership of the node joining a cluster.

How

We acquire the registry reload lock around the reset+copy and in rabbit_ff_registry_wrapper.

@dumbbell dumbbell added this to the 3.13.0 milestone Dec 1, 2023
@dumbbell dumbbell self-assigned this Dec 1, 2023
[Why]
When a node joins another node, it resets its feature flags registry
(the registry is unloaded) and it copies the feature flags states from
the remote cluster.

Before this patch, there was a small window where a concurrent use of
the registry right between these two steps would reload a registry from
the default/empty states, which does not reflect the intent.

This could happen because another node is running peer discovery and
queries the cluster membership of the node joining a cluster.

[How]
We acquire the registry reload lock around the reset+copy and in
`rabbit_ff_registry_wrapper`.
@dumbbell dumbbell force-pushed the protect-feature-flags-registry-reload-with-lock branch from 17fe224 to a1ab343 Compare December 4, 2023 16:48
@dumbbell dumbbell marked this pull request as ready for review December 4, 2023 18:17
@dumbbell dumbbell merged commit ce8fa86 into main Dec 4, 2023
19 checks passed
@dumbbell dumbbell deleted the protect-feature-flags-registry-reload-with-lock branch December 4, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant